package de.hpk.tests;


import static org.junit.Assert.*;

import org.junit.Test;

import de.hpk.jav.Main;


/**
 * @author Alexej
 *
 */
public class FunktionTests extends Main {
//EPSILON FEHLT NOCH!!!		
	
	
	final double eps = 1.0E-8;
	@Test
	public void  visitSingle() {
		expression = "12";
		assertEquals("12.0", eval(expression));
	}
	
	@Test
	public void  test_Leerzeichen() {
		expression = "1 + 4";
		assertEquals("5.0", eval(expression));
	}
	
	@Test
	public void  visitPlusIntegertest() {
		expression = "1.0 + 1.0";
		assertEquals("2.0", eval(expression));
	}
	
	
	@Test
	public void  Allgemein() {
		expression = "1.0 * 2.0  + 3";
		assertEquals("5.0", eval(expression));
	}
	
	@Test
	public void  Allgemein2() {
		expression = "1.0 + 2.0  * 3";
		assertEquals("7.0", eval(expression));
	}
	
	@Test
	public void  visitPlusIntegerStest() {
		expression = "1.0 + 2 + 4";
		assertEquals("7.0", eval(expression));
	}
	
	@Test
	public void  visitPlusIntegerSStest() {
		expression = "1.0 + 2.0 + 4.0 + 5 + 6 + 7";
		assertEquals("25.0", eval(expression));
	}
		
	@Test
	public void visitPlusFloattest() {
		expression = "1.9 + 1.1";
		assertEquals("3.0", eval(expression));
	}
	
	@Test
	public void  visitPlusNumbertest() {
		expression = "1.9 + 1";
		assertEquals("2.9", eval(expression));
	}


}
